In [1]:
import altair as alt
import pandas as pd
import geopandas as gpd
import json
In [2]:
alt.themes.enable('opaque')

pd.set_option('display.max_rows', 200)
In [3]:
# Read in the county geo shapes
gdf_county = gpd.read_file(r'/Users/tinalu/Documents/ISyE Research/Colorado County Files') # TODO: Change file path
gdf_county.columns
Out[3]:
Index(['STATEFP10', 'COUNTYFP10', 'COUNTYNS10', 'GEOID10', 'NAME10',
       'NAMELSAD10', 'LSAD10', 'CLASSFP10', 'MTFCC10', 'CSAFP10', 'CBSAFP10',
       'METDIVFP10', 'FUNCSTAT10', 'ALAND10', 'AWATER10', 'INTPTLAT10',
       'INTPTLON10', 'geometry'],
      dtype='object')
In [4]:
# Find out how many unique counties are in each file
gdf_county.NAME10.unique()
Out[4]:
array(['Larimer', 'Las Animas', 'Fremont', 'Gunnison', 'Conejos', 'Eagle',
       'Otero', 'La Plata', 'Summit', 'Custer', 'Pitkin', 'Crowley',
       'Cheyenne', 'Bent', 'Adams', 'Elbert', 'Yuma', 'Lake', 'Delta',
       'Costilla', 'Garfield', 'Morgan', 'Prowers', 'Montezuma',
       'Mineral', 'Lincoln', 'Jefferson', 'Rio Blanco', 'Sedgwick',
       'San Miguel', 'Alamosa', 'Phillips', 'Ouray', 'Mesa', 'Saguache',
       'Douglas', 'Dolores', 'Rio Grande', 'Pueblo', 'Kit Carson', 'Baca',
       'Grand', 'Logan', 'Clear Creek', 'Moffat', 'Teller', 'Boulder',
       'Kiowa', 'Chaffee', 'Hinsdale', 'Jackson', 'Weld', 'San Juan',
       'Montrose', 'Broomfield', 'Washington', 'Routt', 'Archuleta',
       'Gilpin', 'Denver', 'Park', 'El Paso', 'Arapahoe', 'Huerfano'],
      dtype=object)
In [5]:
# View the first two rows of the county data file
gdf_county.head(2)
Out[5]:
STATEFP10 COUNTYFP10 COUNTYNS10 GEOID10 NAME10 NAMELSAD10 LSAD10 CLASSFP10 MTFCC10 CSAFP10 CBSAFP10 METDIVFP10 FUNCSTAT10 ALAND10 AWATER10 INTPTLAT10 INTPTLON10 geometry
0 08 069 00198150 08069 Larimer Larimer County 06 H1 G4020 None 22660 None A 6723613486 98295250 +40.6630912 -105.4821309 POLYGON ((-105.05672 40.34928, -105.05670 40.3...
1 08 071 00198151 08071 Las Animas Las Animas County 06 H1 G4020 None None None A 12361162110 6929979 +37.3188308 -104.0441103 POLYGON ((-104.14318 37.75833, -104.12615 37.7...
In [6]:
# Make a list of the county name column to count the total number of counties
ct_NMs = gdf_county.NAME10.tolist()
len(ct_NMs)
Out[6]:
64
In [7]:
# Read in the BOD file with the number of hygienists in each county

BOD_df = pd.read_csv('CO_County_hygienist_all.csv') # TODO: Change file name
BOD_df.columns
BOD_df
Out[7]:
County_Name Count
0 Adams 129
1 El Paso 91
2 Denver 64
3 Boulder 50
4 Jefferson 47
5 Weld 46
6 Arapahoe 44
7 Summit 34
8 Larimer 25
9 Garfield 22
10 Montrose 20
11 Elbert 20
12 Douglas 17
13 Lake 16
14 Kit Carson 13
15 Teller 13
16 Pitkin 11
17 Pueblo 9
18 La Plata 9
19 Eagle 7
20 Routt 7
21 Moffat 7
22 Delta 6
23 Park 6
24 Mesa 5
25 Alamosa 3
26 Gunnison 3
27 San Miguel 3
28 Broomfield 3
29 Montezuma 3
30 Morgan 3
31 Phillips 2
32 Rio Blanco 2
33 Fremont 2
34 Chaffee 2
35 Logan 1
36 Dolores 1
37 Archuleta 1
In [8]:
# Make a list of the counties in the BOD file

# Cross check with the total number of counties in the state
# Make sure that all the counties in the state have been matched
# (i.e. number of unique counties in gdf_county equals number of unique counties in BOD_df)

BOD_ct_NMs = BOD_df.County_Name.tolist()

len(BOD_ct_NMs)
Out[8]:
38
In [9]:
# Merge the county shape data (gdf_county) with BOD file containing sums of hygienists by county.
gdf_ct = gdf_county.merge(BOD_df, left_on='NAME10', right_on = 'County_Name', how='left')
In [10]:
gdf_ct.columns
Out[10]:
Index(['STATEFP10', 'COUNTYFP10', 'COUNTYNS10', 'GEOID10', 'NAME10',
       'NAMELSAD10', 'LSAD10', 'CLASSFP10', 'MTFCC10', 'CSAFP10', 'CBSAFP10',
       'METDIVFP10', 'FUNCSTAT10', 'ALAND10', 'AWATER10', 'INTPTLAT10',
       'INTPTLON10', 'geometry', 'County_Name', 'Count'],
      dtype='object')
In [11]:
# Get the centroids so that labels of the number of hygienists can be positioned there.
gdf_ct['centroid_lon'] = gdf_ct['geometry'].centroid.x
gdf_ct['centroid_lat'] = gdf_ct['geometry'].centroid.y

gdf_ct
Out[11]:
STATEFP10 COUNTYFP10 COUNTYNS10 GEOID10 NAME10 NAMELSAD10 LSAD10 CLASSFP10 MTFCC10 CSAFP10 ... FUNCSTAT10 ALAND10 AWATER10 INTPTLAT10 INTPTLON10 geometry County_Name Count centroid_lon centroid_lat
0 08 069 00198150 08069 Larimer Larimer County 06 H1 G4020 None ... A 6723613486 98295250 +40.6630912 -105.4821309 POLYGON ((-105.05672 40.34928, -105.05670 40.3... Larimer 25.0 -105.461155 40.666413
1 08 071 00198151 08071 Las Animas Las Animas County 06 H1 G4020 None ... A 12361162110 6929979 +37.3188308 -104.0441103 POLYGON ((-104.14318 37.75833, -104.12615 37.7... NaN NaN -104.038716 37.315851
2 08 043 00198137 08043 Fremont Fremont County 06 H1 G4020 None ... A 3970627343 2235395 +38.4556576 -105.4214383 POLYGON ((-105.36889 38.25940, -105.36909 38.2... Fremont 2.0 -105.439657 38.472972
3 08 051 00198141 08051 Gunnison Gunnison County 06 H1 G4020 None ... A 8389228965 53172021 +38.6696792 -107.0781080 POLYGON ((-106.79969 38.97965, -106.80009 38.9... Gunnison 3.0 -107.031700 38.666798
4 08 021 00198126 08021 Conejos Conejos County 06 H1 G4020 None ... A 3334326097 9235297 +37.2134065 -106.1764473 POLYGON ((-106.14887 37.40110, -106.14753 37.4... NaN NaN -106.191629 37.200696
5 08 037 00198134 08037 Eagle Eagle County 06 H1 G4020 None ... A 4362911978 18806424 +39.6306381 -106.6929439 POLYGON ((-107.11358 39.49008, -107.11358 39.4... Eagle 7.0 -106.695299 39.627826
6 08 089 00198160 08089 Otero Otero County 06 H1 G4020 None ... A 3268465106 20052451 +37.8841698 -103.7212597 POLYGON ((-103.80303 38.11253, -103.80266 38.1... NaN NaN -103.716446 37.902702
7 08 067 00198148 08067 La Plata La Plata County 06 H1 G4020 None ... A 4382462547 19760255 +37.2873673 -107.8397178 POLYGON ((-107.48206 37.21470, -107.48206 37.2... La Plata 9.0 -107.843335 37.286558
8 08 117 00198174 08117 Summit Summit County 06 H1 G4020 None ... A 1575639358 28282990 +39.6210227 -106.1375545 POLYGON ((-106.17760 39.60906, -106.17758 39.6... Summit 34.0 -106.116379 39.634170
9 08 027 00198129 08027 Custer Custer County 06 H1 G4020 None ... A 1913031045 3364771 +38.1019939 -105.3735148 POLYGON ((-105.56031 37.95189, -105.56235 37.9... NaN NaN -105.367472 38.108678
10 08 097 00198164 08097 Pitkin Pitkin County 06 H1 G4020 None ... A 2514094239 6469384 +39.2175333 -106.9159433 POLYGON ((-106.91537 38.99950, -106.91539 38.9... Pitkin 11.0 -106.916578 39.217106
11 08 025 00198128 08025 Crowley Crowley County 06 H1 G4020 None ... A 2039411297 33430434 +38.3219558 -103.7875617 POLYGON ((-103.70525 38.52226, -103.70487 38.5... NaN NaN -103.784826 38.326661
12 08 017 00198124 08017 Cheyenne Cheyenne County 06 H1 G4020 None ... A 4605713068 8166204 +38.8353865 -102.6045852 POLYGON ((-102.57685 39.04068, -102.56133 39.0... NaN NaN -102.603396 38.827940
13 08 011 00198121 08011 Bent Bent County 06 H1 G4020 None ... A 3918292377 73093771 +37.9318907 -103.0775841 POLYGON ((-103.39863 38.04084, -103.39862 38.0... NaN NaN -103.071705 37.955086
14 08 001 00198116 08001 Adams Adams County 06 H1 G4020 216 ... A 3024207713 42070226 +39.8743252 -104.3318718 POLYGON ((-104.58249 39.73964, -104.58362 39.7... Adams 129.0 -104.337935 39.873634
15 08 039 00198136 08039 Elbert Elbert County 06 H1 G4020 216 ... A 4793671177 442165 +39.3108167 -104.1179275 POLYGON ((-104.19381 39.56523, -104.19169 39.5... Elbert 20.0 -104.135892 39.286560
16 08 125 00198178 08125 Yuma Yuma County 06 H1 G4020 None ... A 6123779829 11134777 +40.0006314 -102.4226490 POLYGON ((-102.80181 39.68163, -102.80179 39.6... NaN NaN -102.424226 40.002899
17 08 065 00198149 08065 Lake Lake County 06 H1 G4020 None ... A 976194290 18124336 +39.2043161 -106.3496959 POLYGON ((-106.48309 39.25525, -106.48310 39.2... Lake 16.0 -106.344838 39.202379
18 08 029 00198130 08029 Delta Delta County 06 H1 G4020 None ... A 2957896781 16960873 +38.8617559 -107.8647570 POLYGON ((-107.84856 38.66811, -107.84860 38.6... Delta 6.0 -107.862877 38.861374
19 08 023 00198127 08023 Costilla Costilla County 06 H1 G4020 None ... A 3177789979 8828904 +37.2775474 -105.4289399 POLYGON ((-105.73841 37.30676, -105.73842 37.3... NaN NaN -105.428269 37.278096
20 08 045 00198138 08045 Garfield Garfield County 06 H1 G4020 None ... A 7634153703 21430621 +39.5993517 -107.9097801 POLYGON ((-107.88414 39.36619, -107.88424 39.3... Garfield 22.0 -107.903954 39.599307
21 08 087 00198159 08087 Morgan Morgan County 06 H1 G4020 None ... A 3316304952 34473998 +40.2623535 -103.8070921 POLYGON ((-103.98576 40.52415, -103.97504 40.5... Morgan 3.0 -103.809821 40.262707
22 08 099 00198165 08099 Prowers Prowers County 06 H1 G4020 None ... A 4243422095 15352661 +37.9581814 -102.3921613 POLYGON ((-102.74133 38.00613, -102.74136 38.0... NaN NaN -102.393349 37.955183
23 08 083 00198157 08083 Montezuma Montezuma County 06 H1 G4020 None ... A 5256450876 27516854 +37.3380246 -108.5957863 POLYGON ((-109.04583 37.32684, -109.04584 37.3... Montezuma 3.0 -108.596713 37.338414
24 08 079 00198155 08079 Mineral Mineral County 06 H1 G4020 None ... A 2267965576 5222183 +37.6514782 -106.9322997 POLYGON ((-106.85925 37.92858, -106.85290 37.9... NaN NaN -106.924095 37.668996
25 08 073 00198152 08073 Lincoln Lincoln County 06 H1 G4020 None ... A 6676021407 22780586 +38.9937401 -103.5075545 POLYGON ((-103.15519 39.28698, -103.15519 39.2... NaN NaN -103.513965 38.988069
26 08 059 00198145 08059 Jefferson Jefferson County 06 H1 G4020 216 ... A 1979289991 25446228 +39.5864595 -105.2456005 MULTIPOLYGON (((-105.06446 39.65333, -105.0644... Jefferson 47.0 -105.250472 39.586422
27 08 103 00198167 08103 Rio Blanco Rio Blanco County 06 H1 G4020 None ... A 8342179365 4868121 +39.9726062 -108.2006849 POLYGON ((-108.21650 40.22176, -108.21388 40.2... Rio Blanco 2.0 -108.217208 39.979841
28 08 115 00198173 08115 Sedgwick Sedgwick County 06 H1 G4020 None ... A 1419419181 3530734 +40.8715679 -102.3553579 POLYGON ((-102.65211 40.88463, -102.65211 40.8... NaN NaN -102.351791 40.875905
29 08 113 00198172 08113 San Miguel San Miguel County 06 H1 G4020 None ... A 3332308274 5213876 +38.0093735 -108.4273260 POLYGON ((-108.33659 37.89384, -108.33884 37.8... San Miguel 3.0 -108.405846 38.003745
30 08 003 00198117 08003 Alamosa Alamosa County 06 H1 G4020 None ... A 1871636898 1807726 +37.5684423 -105.7880414 POLYGON ((-106.03930 37.57699, -106.03930 37.5... Alamosa 3.0 -105.788287 37.572892
31 08 095 00198163 08095 Phillips Phillips County 06 H1 G4020 None ... A 1781724987 301808 +40.5947117 -102.3451047 POLYGON ((-102.38226 40.74935, -102.38176 40.7... Phillips 2.0 -102.357580 40.593884
32 08 091 00198161 08091 Ouray Ouray County 06 H1 G4020 None ... A 1402718909 1599543 +38.1505999 -107.7671334 POLYGON ((-107.95565 38.22649, -107.95659 38.2... NaN NaN -107.769317 38.155497
33 08 077 00198154 08077 Mesa Mesa County 06 H1 G4020 None ... A 8622002815 31466745 +39.0194924 -108.4618366 POLYGON ((-108.23040 38.87777, -108.23058 38.8... Mesa 5.0 -108.466451 39.018279
34 08 109 00198170 08109 Saguache Saguache County 06 H1 G4020 None ... A 8206440775 4454555 +38.0339518 -106.2466749 POLYGON ((-106.69375 37.84833, -106.69374 37.8... NaN NaN -106.281556 38.080553
35 08 035 00198133 08035 Douglas Douglas County 06 H1 G4020 216 ... A 2176232357 6789381 +39.3264348 -104.9261993 POLYGON ((-104.87237 39.56600, -104.87223 39.5... Douglas 17.0 -104.929561 39.329723
36 08 033 00198132 08033 Dolores Dolores County 06 H1 G4020 None ... A 2763650142 2716145 +37.7476020 -108.5303829 POLYGON ((-108.82052 37.88085, -108.82050 37.8... Dolores 1.0 -108.517221 37.751598
37 08 105 00198168 08105 Rio Grande Rio Grande County 06 H1 G4020 None ... A 2361959921 983955 +37.4857631 -106.4532135 POLYGON ((-106.22261 37.74810, -106.22096 37.7... NaN NaN -106.383210 37.582523
38 08 101 00198166 08101 Pueblo Pueblo County 06 H1 G4020 None ... A 6179980907 30279808 +38.1706581 -104.4898925 POLYGON ((-104.94075 38.33753, -104.94075 38.3... Pueblo 9.0 -104.512847 38.173424
39 08 063 00198147 08063 Kit Carson Kit Carson County 06 H1 G4020 None ... A 5596502129 2251930 +39.3053399 -102.6030226 POLYGON ((-102.73931 39.56798, -102.73927 39.5... Kit Carson 13.0 -102.602887 39.305441
40 08 009 00198120 08009 Baca Baca County 06 H1 G4020 None ... A 6617333541 6142194 +37.3031437 -102.5354566 POLYGON ((-102.27023 36.99432, -102.27035 36.9... NaN NaN -102.560469 37.319183
41 08 049 00198140 08049 Grand Grand County 06 H1 G4020 None ... A 4781971576 60250184 +40.1232891 -106.0958757 POLYGON ((-106.08984 40.35006, -106.08983 40.3... NaN NaN -106.118358 40.102615
42 08 075 00198153 08075 Logan Logan County 06 H1 G4020 None ... A 4761813494 16363561 +40.7280911 -103.0904639 POLYGON ((-103.57379 40.89089, -103.57361 40.8... Logan 1.0 -103.110103 40.724678
43 08 019 00198125 08019 Clear Creek Clear Creek County 06 H1 G4020 216 ... A 1023632674 3280082 +39.6894025 -105.6707908 POLYGON ((-105.72413 39.81902, -105.72388 39.8... NaN NaN -105.644359 39.689102
44 08 081 00198156 08081 Moffat Moffat County 06 H1 G4020 None ... A 12285064917 19741780 +40.5739839 -108.2045214 POLYGON ((-108.05866 40.22189, -108.05893 40.2... Moffat 7.0 -108.207298 40.618425
45 08 119 00198175 08119 Teller Teller County 06 H1 G4020 None ... A 1442767059 4944570 +38.8719937 -105.1825519 POLYGON ((-105.32892 38.85756, -105.32893 38.8... Teller 13.0 -105.161826 38.882172
46 08 013 00198122 08013 Boulder Boulder County 06 H1 G4020 216 ... A 1881080439 36469028 +40.0948262 -105.3983824 MULTIPOLYGON (((-105.06350 39.97214, -105.0624... Boulder 50.0 -105.357742 40.092474
47 08 061 00198146 08061 Kiowa Kiowa County 06 H1 G4020 None ... A 4578495505 47033007 +38.3884664 -102.7562096 POLYGON ((-103.02564 38.61499, -103.01200 38.6... NaN NaN -102.740358 38.432682
48 08 015 00198123 08015 Chaffee Chaffee County 06 H1 G4020 None ... A 2624702242 4013482 +38.7382457 -106.3169723 POLYGON ((-106.45187 38.69834, -106.45213 38.6... Chaffee 2.0 -106.194067 38.746903
49 08 053 00198142 08053 Hinsdale Hinsdale County 06 H1 G4020 None ... A 2893667726 15324669 +37.8116248 -107.3834054 POLYGON ((-107.51750 37.83752, -107.51775 37.8... NaN NaN -107.300312 37.821342
50 08 057 00198144 08057 Jackson Jackson County 06 H1 G4020 None ... A 4179523206 18749970 +40.6634319 -106.3292476 POLYGON ((-106.68866 40.65077, -106.69127 40.6... NaN NaN -106.342795 40.666433
51 08 123 00198177 08123 Weld Weld County 06 H1 G4020 216 ... A 10326898757 76554163 +40.5557944 -104.3836487 MULTIPOLYGON (((-104.97668 40.03288, -104.9763... Weld 46.0 -104.392525 40.554840
52 08 111 00198171 08111 San Juan San Juan County 06 H1 G4020 None ... A 1003588157 2035933 +37.7810745 -107.6702566 POLYGON ((-107.51750 37.83752, -107.51734 37.8... NaN NaN -107.676147 37.764043
53 08 085 00198158 08085 Montrose Montrose County 06 H1 G4020 None ... A 5803373218 4923280 +38.4134267 -108.2630424 POLYGON ((-108.58368 38.49999, -108.58230 38.4... Montrose 20.0 -108.269356 38.402185
54 08 014 01945881 08014 Broomfield Broomfield County 06 H6 G4020 216 ... C 85557538 1466175 +39.9533825 -105.0521250 MULTIPOLYGON (((-105.09483 39.95810, -105.0947... Broomfield 3.0 -105.052798 39.954181
55 08 121 00198176 08121 Washington Washington County 06 H1 G4020 None ... A 6521670287 15207421 +39.9654130 -103.2096046 POLYGON ((-103.21731 39.56621, -103.21749 39.5... NaN NaN -103.201253 39.971062
56 08 107 00198169 08107 Routt Routt County 06 H1 G4020 None ... A 6117619257 15825586 +40.4831597 -106.9852885 POLYGON ((-106.65274 40.38897, -106.65274 40.3... Routt 7.0 -106.991193 40.485068
57 08 007 00198119 08007 Archuleta Archuleta County 06 H1 G4020 None ... A 3496937899 13827529 +37.2023952 -107.0508634 POLYGON ((-107.25497 37.00001, -107.25505 37.0... Archuleta 1.0 -107.048329 37.193596
58 08 047 00198139 08047 Gilpin Gilpin County 06 H1 G4020 216 ... A 388229109 941918 +39.8610823 -105.5289473 POLYGON ((-105.40069 39.93507, -105.40063 39.9... NaN NaN -105.522531 39.857558
59 08 031 00198131 08031 Denver Denver County 06 H6 G4020 216 ... C 396268588 4225359 +39.7618487 -104.8806251 MULTIPOLYGON (((-104.93413 39.70014, -104.9341... Denver 64.0 -104.876365 39.762028
60 08 093 00198162 08093 Park Park County 06 H1 G4020 216 ... A 5682034441 43530574 +39.1189141 -105.7176479 POLYGON ((-105.97508 38.91009, -105.97530 38.9... Park 6.0 -105.717175 39.119303
61 08 041 00198135 08041 El Paso El Paso County 06 H1 G4020 None ... A 5508389808 7111582 +38.8273831 -104.5274718 POLYGON ((-104.86402 39.12979, -104.86382 39.1... El Paso 91.0 -104.525583 38.832093
62 08 005 00198118 08005 Arapahoe Arapahoe County 06 H1 G4020 216 ... A 2067070049 19003734 +39.6446318 -104.3317329 MULTIPOLYGON (((-104.89915 39.62413, -104.8991... Arapahoe 44.0 -104.339219 39.649772
63 08 055 00198143 08055 Huerfano Huerfano County 06 H1 G4020 None ... A 4120672901 5792112 +37.6878154 -104.9599278 POLYGON ((-105.01373 37.88127, -105.01281 37.8... NaN NaN -104.960585 37.684680

64 rows × 22 columns

In [12]:
gdf_ct.dtypes
Out[12]:
STATEFP10         object
COUNTYFP10        object
COUNTYNS10        object
GEOID10           object
NAME10            object
NAMELSAD10        object
LSAD10            object
CLASSFP10         object
MTFCC10           object
CSAFP10           object
CBSAFP10          object
METDIVFP10        object
FUNCSTAT10        object
ALAND10            int64
AWATER10           int64
INTPTLAT10        object
INTPTLON10        object
geometry        geometry
County_Name       object
Count            float64
centroid_lon     float64
centroid_lat     float64
dtype: object
In [13]:
# Convert the sums of hygienists into strings so that they can be used as labels
gdf_ct['Count'] = gdf_ct['Count'].astype(str)
In [14]:
# Convert data into json, since Altair expects the json data format.
choro_json = json.loads(gdf_ct.to_json())
In [15]:
# Extract the part that Altair wants for mapping
choro_data = alt.Data(values=choro_json['features'])
# choro_data
In [17]:
# Function to define how the map will be made.
def gen_map(geodata, color_column, title, tooltip):
    '''Generates map of counties with labels'''
    # Add Base Layer
    base = alt.Chart(geodata, title = title).mark_geoshape(
        fill='black',
        stroke='black',
        strokeWidth=1
    ).encode(
    ).properties(
        width=800,
        height=800
    )
    
    choro = alt.Chart(geodata).mark_geoshape().encode(
            color=alt.Color(color_column, 
                            legend=alt.Legend(title="Number of Hygienists"), 
                            scale=alt.Scale(scheme='redpurple', nice=True)
            ), tooltip=[alt.Tooltip('properties.NAME10:O', title='County'),
                        alt.Tooltip('properties.Count:Q', title='Number of Hygienists')]
            ).transform_lookup(
                lookup='properties',
                from_=alt.LookupData(geodata, 'properties', ['Count'])
            )
    
# Add Labels Layer. Here they are the sums of dentists per county.
    labels = alt.Chart(geodata).mark_text(baseline='top'
     ).properties(
        width=400,
        height=400
     ).encode(
         longitude='properties.centroid_lon:Q',
         latitude='properties.centroid_lat:Q',
         text='properties.Count:O',
         size=alt.value(10),
         opacity=alt.value(1)
     )
    
    return base + choro #use this line if you don't want the text labels   
#     return base + choro + labels #use this line if you want the text labels

# Call function, pass the appropriate parameters.
state_hygienist_map = gen_map(geodata=choro_data, color_column='properties.Count:Q', 
            title='Colorado Number of Hygienists per County', # TODO: Change state name
            tooltip=['properties.NAME10:O','properties.Count:Q'])

state_hygienist_map
Out[17]: